<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../../datepicker/jquery-ui.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/app.css">
    <link type="text/css" rel="stylesheet" href="../../css/loginMobile.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/my.css">
    <script type="text/javascript" src="../../js/jquery.min.js"></script>
    <script type="text/javascript" src="/pc/js/all.js"></script>
</head>
<body>
<!--
    制作者：九哥
    页面：我的信息
    时间：2019-03-23
    更新：
-->





<!---------- 我的信息 ---------->
<div id="settingPage">
    <div id="settingTitle">
        <b>我的信息</b>
        <img src="../../images/return.png" id="settingRtn">
    </div>
    <div class="myTable">
        <a href="javascript:;" onclick="getHead()">
            <div class="table-box">
                <div class="tableTitle">
                    头像
                </div>
                <div class="arrow-box">
                    <b class="right">
                        <i class="right-arrow1"></i>
                        <i class="right-arrow2"></i>
                    </b>
                </div>
                <div id="head">
                    <img  >
                </div>
            </div>
        </a>
        <hr>
        <a href="javascript:;" onclick="getNickname()">
            <div class="table-box">
                <div class="tableTitle">
                    昵称
                </div>
                <div class="arrow-box">
                    <b class="right">
                        <i class="right-arrow1"></i>
                        <i class="right-arrow2"></i>
                    </b>
                </div>
                <div id="nickname"></div>
            </div>
        </a>
        <hr>
        <a href="javascript:;" onclick="getSexName()">
            <div class="table-box">
                <div class="tableTitle">性别</div>
                <div class="arrow-box">
                    <b class="right">
                        <i class="right-arrow1"></i>
                        <i class="right-arrow2"></i>
                    </b>
                </div>
                <div id="sexName"></div>
            </div>
        </a>
    </div>
    <div style="height:10px"></div>
    <p id="infoTitle"></p>
    <div class="myTable" id="info">
        <!--<a href="">-->
            <!--<div class="table-box">-->
                <!--<div class="tableTitle">基本信息</div>-->
                <!--<div class="arrow-box">-->
                    <!--<b class="right">-->
                        <!--<i class="right-arrow1"></i>-->
                        <!--<i class="right-arrow2"></i>-->
                    <!--</b>-->
                <!--</div>-->
            <!--</div>-->
        <!--</a>-->
        <!--<hr>-->
        <!--<a href="">-->
            <!--<div class="table-box">-->
                <!--<div class="tableTitle">扩展信息</div>-->
                <!--<div class="arrow-box">-->
                    <!--<b class="right">-->
                        <!--<i class="right-arrow1"></i>-->
                        <!--<i class="right-arrow2"></i>-->
                    <!--</b>-->
                <!--</div>-->
            <!--</div>-->
        <!--</a>-->
        <!--<hr>-->
        <!--<a href="">-->
            <!--<div class="table-box">-->
                <!--<div class="tableTitle">员工认证</div>-->
                <!--<div class="arrow-box">-->
                    <!--<b class="right">-->
                        <!--<i class="right-arrow1"></i>-->
                        <!--<i class="right-arrow2"></i>-->
                    <!--</b>-->
                <!--</div>-->
            <!--</div>-->
        <!--</a>-->
    </div>
    <div style="height:20px"></div>
</div>
<!---------- 我的信息 ---------->





<!-----------弹窗---------->
<div id="pop">
    <div id="popMask"></div>
    <div id="popDetail">
    </div>
</div>
<!-----------弹窗---------->

<!----------错误提示---------->
<div id="errMsg"></div>
<!----------错误提示---------->
</body>
<script type="text/javascript" src="../../js/app.js"></script>
<script type="text/javascript" src="../../js/mysetPageChange.js"></script>
<script type="text/javascript" src="../../js/myset.js"></script>
<script>
    (function(){
        getSettingInfoMenu(); //我的信息菜单
        getSettingUserInfo(); //获取用户昵称、头像、性别
    })();
    //我的信息菜单
    function getSettingInfoMenu(){
        var userInfo = cacheGet('userInfo'); //获取用户信息
        if (userInfo==null || userInfo.token=='undefined') {
            getAppErrMsg('没有登陆！','/h5/login/login.html',1000); return;
        }
        //console.log(userInfo);
        var menus = new Array();
        var title;
        var i, h = '';
        if (mySettingType==0) {
            type = userInfo.type;
        } else {
            type = mySettingType;
        }
        if (type==1) { //个人
            title = '员工信息';
            menus = [
                { name:'我的个人信息',link:'/h5/login/staffList.html?type=edit' },
                { name:'我的简历',link:'/h5/my/job/resume.html' }
            ];
        } else if (type==2) { //仅公司
            title = '公司信息';
            menus = [
                { name:'我的公司信息',link:'/h5/login/comList.html?type=edit' }
            ];
        } else if (type==3) { //仅工厂
            title = '工厂信息';
            menus = [
                { name:'我的工厂信息',link:'/h5/login/facList.html?type=edit' }
            ];
        } else if (type==4) { //公司含工厂
            title = '公司信息';
            menus = [
                { name:'我的公司信息',link:'/h5/login/comList.html?type=edit' }
            ];
        } else {
            getAppErrMsg('没有登陆！','/h5/login/login.html',1000); return;
        }
        for (i=0;i<menus.length;i++) {
            h += '<a href="'+menus[i].link+'">';
            h +=    '<div class="table-box">';
            h +=        '<div class="tableTitle">'+menus[i].name+'</div>';
            h +=        '<div class="arrow-box">';
            h +=            '<b class="right"><i class="right-arrow1"></i><i class="right-arrow2"></i></b>';
            h +=        '</div>';
            h +=    '</div>';
            h += '</a>';
            if (i<menus.length-1) { h += '<hr>'; }
        }
        $('#info').html(h);
        $('#infoTitle').html(title);
    }
    //获取用户昵称、头像、性别
    function getSettingUserInfo(){
        var userInfo = cacheGet('userInfo'); //获取用户信息
        if (userInfo==null || userInfo.token=='undefined') {
            window.location.href = '/h5/login/login.html';
        }
        var data = {
            app_access:app_access,
            token:userInfo.token,
            type:userInfo.type,
            cate:userInfo.cate
        };
        $.ajax({
            type:'post',
            url:getDomain() + 'myset/userinfo',
            data:data,
            success:function(res){
                //console.log(res); return;
                if (res.code!=0) {
                    console.log(res); return;
                }
                var h = '', h2 = '', sex = res.data.sex;
                if (res.data.head!='') {
                    h += '<img src="'+res.data.head+'">';
                } else {
                    h += '<img src="../../images/user-default.png">';
                }
                $('#head').html(h);
                $('#nickname').html(res.data.nickname);
                if (sex==1) {
                    h2 += '男';
                } else if (sex==2) {
                    h2 += '女';
                } else {
                    h2 += '未定义';
                }
                $('#sexName').html(h2);
            },
            error:function(){
                console.log('操作失败！'); return;
            }
        });
    }
</script>
</html>